<template>
    <div class="child">
        <h3>子组件1</h3>
        <h4>玩具:{{ toy }}</h4>
        <button @click="emitter.emit('send-toy',toy)">把玩具给弟弟</button>

    </div>
</template>

<script setup lang="ts" name="Child1">
import emitter from "@/utils/emitter";
import { ref } from "vue";
let toy = ref("奥特曼")
</script>

<style  scoped>
.child {
    background-color: skyblue;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px black;
}
</style>